package org.spring.springboot.server.Impl;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.read.metadata.ReadSheet;
import lombok.Cleanup;
import org.apache.ibatis.session.RowBounds;
import org.spring.springboot.dao.IntervieweeManageDao;
import org.spring.springboot.dao.biz.BizAllApiDao;
import org.spring.springboot.dao.biz.UpLoadDao;
import org.spring.springboot.entity.IntervieweeManage;
import org.spring.springboot.listenner.EasyExcelListenner;
import org.spring.springboot.server.ExportImportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

@Service
@Transactional
public class ExportImportServiceImpl implements ExportImportService {
    @Autowired
    private BizAllApiDao bizAllApiDao;

    @Override
    public Integer getCount() {
        return bizAllApiDao.selectCount(new IntervieweeManage());
    }

    @Transactional(propagation = Propagation.SUPPORTS)
    @Override
    public List<IntervieweeManage> getListByPage(Integer pageon) {
        Integer begin=(pageon-1)*5000+1;
        return bizAllApiDao.selectByRowBounds(new IntervieweeManage(), new RowBounds(begin,5000));
    }

}
